﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Sinacor.Service.Infra.AuthorizationService.Service.ServiceImplementation.Translator
{
	public static class TranslateBetweenRole
	{
		public static BusinessEntity.Role ToBusinessEntity(DataContract.Response.RoleResponse from)
		{
			BusinessEntity.Role to = new BusinessEntity.Role();
			to.Name = from.Name;
			return to;
		}

		public static DataContract.Response.RoleResponse ToDataContract(BusinessEntity.Role from)
		{
			DataContract.Response.RoleResponse to = new DataContract.Response.RoleResponse();
			to.Name = from.Name;
			return to;
		}

		public static List<DataContract.Response.RoleResponse> ToDataContractList(List<BusinessEntity.Role> from)
		{
			List<DataContract.Response.RoleResponse> to = new List<DataContract.Response.RoleResponse>();
			foreach (BusinessEntity.Role item in from)
			{
				to.Add(ToDataContract(item));
			}
			return to;
		}
	}
}